home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 2810 < prev    next >
Encoding:
Internet Message Format  |  1996-08-06  |  1.5 KB

  1. Path: news.pi.se!usenet
  2. From: Ake Wallin <aw@medonic.se>
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: prob. exporting functions in Borland C++ into DLL
  5. Date: 19 Jan 1996 19:30:31 GMT
  6. Message-ID: <4dorgn$afs@news.pi.se>
  7. NNTP-Posting-Host: d111.sth.pi.se
  8. Mime-Version: 1.0
  9. Content-Type: text/plain; charset=iso-8859-1
  10. Content-Transfer-Encoding: 8bit
  11.  
  12. televis@aix1.danadata.dk (Thomas Zaschke) writes:
  13. > My problem:
  14. > I am writing a Windows-DLL (16-bit), to be used by a non-C application.
  15. > All my sources are compiled with Borlands C++ compiler from within
  16. > Borland C++ 4.53. All extensions are *.cpp.
  17. > I want to export a function "MyFunc".
  18. > 1) When using "_export" before the function-name, the resulting DLL does 
  19. > not
  20. > content the name "MyFunc" as i would expect, but something like 
  21. > "MyFunc$QV".
  22. > 2) When using a .def file and exporting "MyFunc" explicitly, i get this 
  23. > error
  24. > message "Attempt to export non-public symbol <myfunction-name>".
  25. > I do not experience these problems when compiling and linking pure 
  26. > C-source.
  27. > My question is:
  28. > How can I export "MyFunc" in a DLL and be sure that other applications
  29. > actually can see the correct name: "MyFunc" ?
  30. > If I am forced to use a .def file (to export by ordinal), how do I get 
  31. > this
  32. > to work without the before mentioned error ?
  33. > Thomas Zaschke
  34. > televis@aix1.danadata.dk
  35. >
  36.   C++ mangles function names ( to allow overloading). If you need to use a C++ function
  37. outside C++ you must declare it as extern "C".
  38. Regards,
  39. Ake
  40.